package com.studiofortress.sf.graphics.display;

/**
 * GraphicsWindow is for making a window that does
 * not have any borders. In every other respect
 * it works in exactly the same way as a GraphicsFrame.
 * 
 * The title of the window however is never seen on
 * the window. It is set, but the constructor is mainly
 * kept for easy refactoring of code.
 * 
 * By default the appliacation will close automatically
 * when the screen is closed.
 * 
 * @author Joseph Lenton - JL235@kent.ac.uk
 * @version 03/08/07
 */
public class GraphicsWindow extends GraphicsFrame
{
    /**
     * Creates a new GraphicsWindow with the given
     * width and height. The title is set to "".
     * @param width The width of the new borderless window.
     * @param height The height of the new borderless window.
     */
    public GraphicsWindow(int width, int height)
    {
        this(width, height, "");
    }
    
    /**
     * Creates a new GraphicsWindow with the given
     * width and height. The title is not seen on the window,
     * but can be set.
     * @param width The width of the new borderless window.
     * @param height The height of the new borderless window.
     * @param title The title of the new borderless window.
     */
    public GraphicsWindow(int width, int height, String title)
    {
        this(width, height, title, true);
    }
    
    public GraphicsWindow(int width, int height, String title, boolean exitOnClose)
    {
        super(width, height, title, exitOnClose);
    }

    /**
     * Makes this frame undecorated and then displays it as normal.
     */
    @Override
    public void display()
    {
        getContainer().setUndecorated(true);
        super.display();
    }
}